package com.mars.common.i18n;

import org.springframework.context.i18n.LocaleContextHolder;

import com.mars.common.spring.SpringContextHolder;


public class I18nMessage {
	
	/**
	 * 获取国际化信息
	 * @param key 键
	 * @param args 信息中的参数
	 * @return 国际化信息
	 */
	public static String getMessage(String key, Object... args) {
		return SpringContextHolder.getApplicationContext().getMessage(key, args, LocaleContextHolder.getLocale()) ;
		
		/*
		LocaleResolver localeResolver = (LocaleResolver) SpringContextHolder.getBean(LocaleResolver.class);
        Locale localLocale = localeResolver.resolveLocale(SpringContextHolder.getRequest());
        return SpringContextHolder.getApplicationContext().getMessage(key, args, localLocale);
        */
    }
}
